toLeft

inline fun <R> toLeft(right: () -> R): Either<T, R>

Returns a Right containing the given argument right if this is empty, or a Left containing this option's value if it is defined.

Return

a Right containing the given argument right if this is empty, or a Left containing this option's value if it is defined.

Parameters

right

Producer of the fallback Right value.

R

The type of the Right value.